package library.and.xps.com.step.adapter;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

public class RankingTabViewAdapter extends FragmentPagerAdapter {
    private ArrayList<Fragment> frags;
    private List<String> titles;

    public RankingTabViewAdapter(FragmentManager fm, ArrayList<Fragment> data, ArrayList<String> title) {
        super(fm);
        this.frags = data;
        this.titles = title;
    }

    @Override
    public Fragment getItem(int position) {
        return frags.get(position);
    }

    @Override
    public int getCount() {
        return frags.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position % titles.size());
    }
}
